{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑APP用户</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_real_name}" name="user_real_name" placeholder="姓名" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">头像：</label>
                            <input type="hidden" name="user_image" id="lay-img" lay-verify="image">
                            <div class="layui-input-block">
                                <div id="lay-upload">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list">
                                        <img class="layui-append-img" src="{$user.user_image}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_phone}" name="user_phone" placeholder="手机号" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">密码：</label>
                            <div class="layui-input-block">
                                <input type="text" value="" name="user_password" placeholder="密码" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">密码明文：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_password_see}" class="layui-input" disabled>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">昵称：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_username}" name="user_username" placeholder="昵称" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_gender" value="1" {$user.user_gender==1?'checked':''} class="layui-input" title="男"/>
                                <input type="radio" name="user_gender" value="2" {$user.user_gender==2?'checked':''} class="layui-input" title="女"/>
                                <input type="radio" name="user_gender" value="3" {$user.user_gender==3?'checked':''} class="layui-input" title="未知"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">店铺名称：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_shop_name}" name="user_shop_name" placeholder="店铺名称" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">用户角色：</label>
                            <div class="layui-input-block">
<!--                                <input type="checkbox" name="user_rule[]" value="1" title="普通用户" {in name="1" value="$user.user_rule"} checked {/in}>-->
                                <input type="checkbox" name="user_rule[]" value="2" title="特惠商品" {in name="2" value="$user.user_rule"} checked {/in}>
                                <input type="checkbox" name="user_rule[]" value="3" title="脖脸皮" {in name="3" value="$user.user_rule"} checked {/in}>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">脖脸皮系统身份：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_bo_role" value="1" {$user.user_bo_role==1?'checked':''} class="layui-input" title="普通用户" disabled/>
                                <input type="radio" name="user_bo_role" value="2" {$user.user_bo_role==2?'checked':''} class="layui-input" title="自由创业者" disabled/>
                                <input type="radio" name="user_bo_role" value="2" {$user.user_bo_role==3?'checked':''} class="layui-input" title="团员" disabled/>
                                <input type="radio" name="user_bo_role" value="3" {$user.user_bo_role==4?'checked':''} class="layui-input" title="团队长" disabled/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">脖脸皮代理身份：</label>
                            <div class="layui-input-block">
<!--                                <input type="checkbox" name="user_bo_district_role[]" value="1" title="普通用户" {in name="1" value="$user.user_bo_district_role"} checked {/in}>-->
                                <input type="checkbox" name="user_bo_district_role[]" value="2" title="县级运营商" {in name="2" value="$user.user_bo_district_role"} checked {/in}>
                                <input type="checkbox" name="user_bo_district_role[]" value="3" title="市级分公司" {in name="3" value="$user.user_bo_district_role"} checked {/in}>
                                <input type="checkbox" name="user_bo_district_role[]" value="4" title="省级子公司" {in name="4" value="$user.user_bo_district_role"} checked {/in}>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">礼包等级：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_giftbag_level" value="1" {$user.user_giftbag_level==1?'checked':''} class="layui-input" title="普通用户"/>
                                <input type="radio" name="user_giftbag_level" value="2" {$user.user_giftbag_level==2?'checked':''} class="layui-input" title="推广丽人"/>
                                <input type="radio" name="user_giftbag_level" value="3" {$user.user_giftbag_level==3?'checked':''} class="layui-input" title="自由创业者"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">状态：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_status" value="1" {$user.user_status==1?'checked':''} class="layui-input" title="正常"/>
                                <input type="radio" name="user_status" value="2" {$user.user_status==2?'checked':''} class="layui-input" title="冻结"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">查询权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_index" value="2" {$user.user_index==2?'checked':''} class="layui-input" title="正常"/>
                                <input type="radio" name="user_index" value="1" {$user.user_index==1?'checked':''} class="layui-input" title="冻结"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">报备权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_submit" value="2" {$user.user_submit==2?'checked':''} class="layui-input" title="正常"/>
                                <input type="radio" name="user_submit" value="1" {$user.user_submit==1?'checked':''} class="layui-input" title="冻结"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">搜索权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_search" value="2" {$user.user_search==2?'checked':''} class="layui-input" title="正常"/>
                                <input type="radio" name="user_search" value="1" {$user.user_search==1?'checked':''} class="layui-input" title="冻结"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">出入库权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_stock_role" value="1" {$user.user_stock_role==1?'checked':''} class="layui-input" title="否"/>
                                <input type="radio" name="user_stock_role" value="2" {$user.user_stock_role==2?'checked':''} class="layui-input" title="是"/>
                            </div>
                        </div>

<!--                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">-->
<!--                            <label class="layui-form-label">面膜领取权限：</label>-->
<!--                            <div class="layui-input-block">-->
<!--                                <input type="radio" name="giftbag_role" value="1" {$user.user_giftbag_role==1?'checked':''} class="layui-input" title="否"/>-->
<!--                                <input type="radio" name="giftbag_role" value="2" {$user.user_giftbag_role==2?'checked':''} class="layui-input" title="是"/>-->
<!--                            </div>-->
<!--                        </div>-->

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">子商户管理权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_shou_rule" value="1" {$user.user_shou_rule==1?'checked':''} class="layui-input" title="有"/>
                                <input type="radio" name="user_shou_rule" value="2" {$user.user_shou_rule==2?'checked':''} class="layui-input" title="无"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">服务权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_serve_rule" value="1" {$user.user_serve_rule==1?'checked':''} class="layui-input" title="有"/>
                                <input type="radio" name="user_serve_rule" value="2" {$user.user_serve_rule==2?'checked':''} class="layui-input" title="无"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">管理服务权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_fp_serve_rule" value="1" {$user.user_fp_serve_rule==1?'checked':''} class="layui-input" title="有"/>
                                <input type="radio" name="user_fp_serve_rule" value="2" {$user.user_fp_serve_rule==2?'checked':''} class="layui-input" title="无"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">定金权限：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_dj_rule" value="1" {$user.user_dj_rule==1?'checked':''} class="layui-input" title="有"/>
                                <input type="radio" name="user_dj_rule" value="2" {$user.user_dj_rule==2?'checked':''} class="layui-input" title="无"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">家大业大：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_big_rule" value="1" {$user.user_big_rule==1?'checked':''} class="layui-input" title="有"/>
                                <input type="radio" name="user_big_rule" value="2" {$user.user_big_rule==2?'checked':''} class="layui-input" title="无"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">普通身份状态：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_giftbag_show" value="1" {$user.user_giftbag_show==1?'checked':''} class="layui-input" title="显示"/>
                                <input type="radio" name="user_giftbag_show" value="2" {$user.user_giftbag_show==2?'checked':''} class="layui-input" title="隐藏"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">系统身份状态：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_system_show" value="1" {$user.user_system_show==1?'checked':''} class="layui-input" title="显示"/>
                                <input type="radio" name="user_system_show" value="2" {$user.user_system_show==2?'checked':''} class="layui-input" title="隐藏"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">运营身份状态：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_dl_show" value="1" {$user.user_dl_show==1?'checked':''} class="layui-input" title="显示"/>
                                <input type="radio" name="user_dl_show" value="2" {$user.user_dl_show==2?'checked':''} class="layui-input" title="隐藏"/>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">福利权限：</label>
                            <div class="layui-input-block">
                                <select name="user_th_rule" lay-search="">
                                    <option value="0">---- 请选择福利权限 ----</option>
                                    {foreach name="rule" item="vo3"}
                                    <option value="{$vo3.rule_id}" {$vo3.rule_id == $user.user_th_rule ? 'selected' : ''}>{$vo3.rule_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md12">
                            <label class="layui-form-label">地区：</label>
                            <div class="layui-input-inline">
                                <select name="user_sheng" lay-search="" id="province"  lay-filter="province">
                                    <option value="">---- 请选择省 ----</option>
                                    {foreach name="province" item="vo"}
                                    <option value="{$vo.district_id}" {$vo.district_id == $user.user_sheng ? 'selected' : ''}>{$vo.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <div class="layui-input-inline">
                                <select name="user_shi" lay-search=""  id="city"  lay-filter="city">
                                    {foreach name='city' item='vo1'}
                                    <option value="{$vo1.district_id}" {$vo1.district_id == $user.user_shi ? 'selected' : ''}>{$vo1.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                            <div class="layui-input-inline">
                                <select name="user_qu" lay-search=""  id="district"  lay-filter="district">
                                    {foreach name='qu' item='vo2'}
                                    <option value="{$vo2.district_id}" {$vo2.district_id == $user.user_qu ? 'selected' : ''}>{$vo2.district}</option>
                                    {/foreach}
                                </select>
                            </div>

                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">详细地址：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_address}" name="user_address" placeholder="详细地址" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">银行账户：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_bank_username}" name="user_bank_username" placeholder="银行账户" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">开户行：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_bank_name}" name="user_bank_name" placeholder="开户行" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">卡号：</label>
                            <div class="layui-input-block">
                                <input type="text" value="{$user.user_bankcard_code}" name="user_bankcard_code" placeholder="卡号" class="layui-input">
                            </div>
                        </div>

                        <input type="hidden" value="{$user_id}" name="user_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <!--<button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script>
    wk.uploadImg({size:2,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}",domain:""});
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
           $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('appMemberDetail')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        });
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
